import request from '@/utils/request'
import type { defaultKeysAndHotKeys } from './interface/searchData'

export default {
  getKeyWords() {
    return request.get<null, defaultKeysAndHotKeys>('/xhr/search/init.json')
  },
  getMomentWords(keyword: string) {
    return request.get<null, string[]>(`/xhr/search/searchAutoComplete.json?keywordPrefix=${keyword}`)
  },
  getSearchInfo(keyword: string) {
    return request.get<any, any>(`/xhr/search/search.json?__timestamp=1630133434953&needPopWindow=true&searchWordSource=7&stillSearch=false&_stat_search=autoComplete&itemId=0&size=40&upperPrice=-1&floorPrice=-1&matchType=0&categoryId=0&descSorted=false&sortType=0&keyword=${keyword}`)
  }
}
